using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IdleState : IState
{
    public IdleState(FSM manger)
    {
        this.manager = manger;

    }


    public override void OnEnter()
    {
        manager.animator.Play("Idle");
    }

    public override void OnExit()
    {
        
    }

    public override void OnFixedUpdate()
    {
        manager.Move();
    }

    public override void OnUpdate()
    {
       if(manager.isHurt)
        {
            manager.TranssitionState(StateType.Hurt);    


        }
       if(manager.rb.velocity.x>0.1f||manager.rb.velocity.x<-0.1f)
        {
            manager.TranssitionState(StateType.Move);
        }
       if(manager.isJump)
        {
            manager.TranssitionState(StateType.Jump);
        }
    }
}
